HTML <td> headers attribute Example
Example: In this example we demonstrates the usage of the <td> headers attribute for associating data cells with header cells in a table, enhancing accessibility and aiding screen readers in interpreting tabular data.
html
<!DOCTYPE html> < html > < head > < style > table, th, td { border: 1px solid green; } </ style > </ head > < body > < h2 > HTML < td > Headers Attributes </ h2 > < table > < tr > < th id = "name" >Name</ th > < th id = "father" >Father's Name</ th > < th id = "mother" >Mother's Name</ th > < th id = "phone" >Phone No.</ th > </ tr > < tr > < td headers = "name" >Krishna</ td > < td headers = "father" > Manoj Gupta </ td > < td headers = "mother" > Manisha Gupta </ td > < td headers = "phone" >12345</ td > </ tr > </ table > < br /> </ body > </ html > |
Output:
headers Attribute example output" height="inherit" src="/public/files/manas-2.png" width="inherit"> Supported Browsers:
The browsers supported by HTML <td> headers Attribute are listed below:
HTML headers Attribute
The HTML <td> headers attribute specifies the header cells related to a table cell, aiding accessibility for screen readers without visual impact in web browsers.
Syntax
<td headers="header_id">